<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel='stylesheet' type='text/css' href='${initParam.root }/css/mentoring.css' />
<c:set value="${sessionScope.mvo }" var="mvo"></c:set>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript">
	$(function(){
   		 $("#noteList").scrollTop($("#noteList")[0].scrollHeight);
	});
	
</script>
</head>
<body>
${requestScope.map.uid } 님과의 대화창
<div id="note" align="center">

<div id="noteList">
	<table id="noteListTable">
		<tbody>
		<c:forEach items="${requestScope.nlist }" var="n"> 
			<tr>
			<c:choose>
				<c:when test="${n.sender.id ==sessionScope.mvo.id}">
					<td></td>
					<td class="contentalign">
						<a href="${initParam.root }/mentoring/senderDeleteNote.do?no=${n.no }&uid=${requestScope.map.uid}">x
						</a>
						<c:choose>
							<c:when test="${n.receiveDate==null }">
								<font color='white'>${n.content} </font>
							</c:when>
							<c:otherwise>
								${n.content} 
							</c:otherwise>
						</c:choose>	
						
					</td>
					<td>ME / ${n.sendDate }</td>
				</c:when>
				<c:otherwise>
				<td style="text-align: right">${n.sendDate } / ${requestScope.map.uid}</td>
					<td>${n.content} 
							<a href="${initParam.root }/mentoring/receiverDeleteNote.do?no=${n.no }&uid=${requestScope.map.uid}">x
						</a>	
					</td>
					<td></td>
				</c:otherwise>
			</c:choose>
			
			</tr>
		</c:forEach> 
		</tbody>
	</table>
</div>
<div id="sendNote">
<form action="sendNote.do" name="sendNoteForm">
<input type="hidden" name="receiver.id" value="${requestScope.map.uid }">
		<textarea rows="5" cols="10" style="margin: 4px 0px 0px; width: 380px; height: 50px; resize:none" name="content"></textarea>
		<input type="submit" value="전송">
</form>
</div>
</div>
</body>
</html>